package com.example.demo.controller;

import com.example.demo.dto.BaseRs;
import com.example.demo.error.BaseException;
import com.example.demo.error.StatusCodeEnum;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class IndexController {
    @RequestMapping("/a")
    @ResponseBody
    public BaseRs a() throws Exception{
        boolean s = false;
        if(!s){
            BaseException.error(StatusCodeEnum.USER_INVALID);
        }
        return new BaseRs(StatusCodeEnum.SUCCESS);
    }
}
